let proxy = null;
try {
  const fs = require('fs');
  const path = require('path');
  const data = fs.readFileSync(path.join(__dirname, 'proxy.json'), 'utf-8');
  proxy = JSON.parse(data);
} catch (e) {
  proxy = null;
}

module.exports = {

  publicPath: './',
  outputDir: 'dist',
  productionSourceMap: false, // 不生成 map 文件

  devServer: {
    open: true, // 自动打开浏览器
    host: '0.0.0.0',
    port: 8080,
    https: false,
    hotOnly: false,
    disableHostCheck: true,
    proxy: proxy,
    before: app => {}
  },

  runtimeCompiler: true,

  configureWebpack: {
    // externals: {
    //   vue: 'Vue',
    //   'element-ui': 'ELEMENT',
    //   axios: 'axios',
    // }
  }
}